package com.IntelligentCommunity.algorithm.api;

import com.IntelligentCommunity.algorithm.api.factory.AlgorithmFallbackFactory;
import com.IntelligentCommunity.algorithm.domain.FaceImgResponse;
import com.IntelligentCommunity.algorithm.domain.FaceRecognitionConf;
import com.IntelligentCommunity.algorithm.domain.request.FaceAddRequest;
import com.IntelligentCommunity.common.core.constant.ServiceNameConstants;
import com.IntelligentCommunity.common.core.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


/**
 * @author 美国五星上将麦克阿瑟
 */
@FeignClient(value = ServiceNameConstants.ALGORITHM_SERVICE, fallbackFactory = AlgorithmFallbackFactory.class, path = "/face")
public interface AlgorithmRemote {

    @PostMapping("/faceAdd")
    public R faceInsert(@RequestBody FaceAddRequest faceAddRequest);

    @PostMapping("/faceRec")
    public R faceRec(@RequestBody FaceRecognitionConf faceRecognitionConf);

    @GetMapping("/faceFindBySubject")
    public R<FaceImgResponse> faceFindBySubject(@RequestParam("subjectName") String subjectName);

    @PostMapping("/faceDet")
    public R faceDet(@RequestBody FaceRecognitionConf faceRecognitionConf);

    /**
     * 按名称删除主题的所有示例
     */
    @PostMapping("/delBySubject")
    public R delBySubject(@RequestParam("subject") String subject);

    /**
     * 批量添加人脸照片
     */
    @PostMapping("/faceAddBath")
    public R faceInsertBath(@RequestBody List<FaceAddRequest> faceAddRequestList);

    @PostMapping("/delBySubjects")
    public R delBySubjects(@RequestParam("subject") List<String> subjects);

}
